<?php
/**
 * Created by PhpStorm.
 * User: czm
 * Date: 2019-07-09
 * Time: 11:06
 */
namespace  app\admin\controller;

use think\Controller;
use think\Db;

class Telephone extends Controller
{
    public function telephonesList()
    {
        $list = Db::name('telephone')->select();
        $this->assign('data',$list);
        return $this->fetch();
    }

    public function telephonesAdd()
    {
        if (request()->isPost())
        {
            $data = input('post.');
//            $data = [
//                'title' =>  input('title'),
//                'phone' =>  input('phone'),
//            ];
            $res = Db::name('telephone')->insert($data);
            if ($res){
                return show(200);
            }else{
                return show(403);
            }
        }
        return $this->fetch();
    }
}